package com.weixin.engine.controller;

import com.weixin.common.core.doman.Result;
import com.weixin.common.dto.EmployeeProjectDTO;
import com.weixin.engine.models.pojo.EmployeeProject;
import com.weixin.engine.models.service.IAviatorExpressionService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Bummon
 * @description
 * @date 2023-07-22 14:32
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/performance")
public class PerformanceController {

    private final IAviatorExpressionService expressionService;

    @GetMapping("/calculate")
    public Result calculatePerformance() {
        List<EmployeeProjectDTO> employeeProjects = expressionService.calculatePerformance();
        return Result.SUCCESS(employeeProjects);
    }

}
